<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小型计算器</title>
</head>
<body>
    <script>
        function s() 
        {
            var a=document.getElementById("nub1").value
            var b=Math.round(a)
            document.getElementById("1").innerHTML=b;   
        }
        function s1()
        {
            var a=document.getElementById("nub1").value
            var b=Math.ceil(a)
            document.getElementById("1").innerHTML=b;   
        }
        function s2()
        {
            var a=document.getElementById("nub1").value
            var b=Math.floor(a)
            document.getElementById("1").innerHTML=b;   
        }
        function gen()
        {
            var a=document.getElementById("nub1").value
            var b=Math.sqrt(a)
            document.getElementById("1").innerHTML=b;   
        }
        function jue()
        {
            var a=document.getElementById("nub1").value
            var b=Math.abs(a)
            document.getElementById("1").innerHTML=b;   
        }
        function sin()
        {
            var a=document.getElementById("nub1").value
            var b=Math.sin(a)
            document.getElementById("1").innerHTML=b;   
        }
        function cos()
        {
            var a=document.getElementById("nub1").value
            var b=Math.cos(a)
            document.getElementById("1").innerHTML=b;   
        }
        function ln()
        {
            var a=document.getElementById("nub1").value
            var b=Math.log(a)
            document.getElementById("1").innerHTML=b;   
        }

        function da()
        {
            var a=document.getElementById("nub2").value
            var b=document.getElementById("nub3").value
            var c=Math.max(a,b)
            document.getElementById("2").innerHTML=c; 
        }
        function xiao()
        {
            var a=document.getElementById("nub2").value
            var b=document.getElementById("nub3").value
            var c=Math.min(a,b)
            document.getElementById("2").innerHTML=c; 
        }

    </script>
    
        原始数据输入：<input type="text" id="nub1"><br>
        <input type="button" value="取整(四舍五入)" id="zheng1" onclick="s()")>
        <input type="button" value="取整(大于)" id="zheng2" onclick="s1()")>
        <input type="button" value="取整(小于)" id="zheng3" onclick="s2()")><br>
        <input type="button" value="平方根" id="gen" onclick="gen()")>
        <input type="button" value="绝对值" id="jue" onclick="jue()")>
        <input type="button" value="正弦" id="sin" onclick="sin()")>
        <input type="button" value="余弦" id="cos" onclick="cos()")>
        <input type="button" value="自然对数" id="LN" onclick="ln()")>
        <br>
        <div class="re1">
            
            运算结果:  <span id="1"></span>
            </div> 
        <br>
        原始数据输入：<input type="text" id="nub2">
        <input type="text" id="nub3"><br>
        <input type="button" value="求较大值" id="max" onclick="da()")>
        <input type="button" value="求较小值" id="min" onclick="xiao()")>
        <br>
        <div class="re2">
            运算结果:  <span id="2"></span>
            </div>
</body>
</html>